{template "header.html"}

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-sitemap"></i> 网站地图 </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">

                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                    <div class="form-body form">
                        {if $is_xml_file}
                        <div class="note note-danger">
                            <p>根目录存在文件/sitemap.txt，请手动将此文件删除，否则影响数据生成</p>
                        </div>
                        {/if}
                        {loop $module $t}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{$t.name}（{$t.dirname}）</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[sitemap][{$t.dirname}]" value="1" {if $data['sitemap'][$t.dirname]}checked{/if} data-on-text="{dr_lang('已开启')}" data-off-text="{dr_lang('已关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <div class="input-group" style="margin-top: 10px;">
                                    <span class="input-group-addon">
                                        SQL条件（可选）
                                    </span>
                                    <input type="text" class="form-control" name="data[where][{$t.dirname}]" value="{$data['where'][$t.dirname]}" placeholder="写生成sitemap的查询条件，必须精通SQL语句，否则会系统崩溃"> </div>
                            </div>
                        </div>
                        {/loop}

                        <div class="form-group">
                            <label class="col-md-2 control-label">&nbsp;</label>
                            <div class="col-md-9">
                                <span class="help-block">{dr_lang('开启之后当前模块的内容才会出现在sitemap')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">&nbsp;</label>
                            <div class="col-md-9">
                                <span class="help-block">-</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">是否显示栏目地址</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[sitemap_cat]" value="1" {if $data['sitemap_cat']}checked{/if} data-on-text="{dr_lang('已开启')}" data-off-text="{dr_lang('已关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">将栏目地址加入到sitemap中</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">是否显示首页地址</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[sitemap_index]" value="1" {if $data['sitemap_index']}checked{/if} data-on-text="{dr_lang('已开启')}" data-off-text="{dr_lang('已关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">将首页地址加入到sitemap中</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('最大显示内容数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[sitemap_limit]" value="{php echo $data['sitemap_limit'] ? $data['sitemap_limit'] : '1000';}"></label>
                                <span class="help-block">{dr_lang('sitemap中显示的最多显示的模块内容数量')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('每页显示数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[sitemap_pagesize]" value="{php echo $data['sitemap_pagesize'] ? $data['sitemap_pagesize'] : '0';}"></label>
                                <span class="help-block">{dr_lang('0表示不启用分页，设置此项表示开启分页，分页来显示的内容数量，分页地址格式是：sitemap2.txt或者sitemap2.xml，其中2表示页码')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('首页priority值')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[priority_index]" value="{php echo $data['priority_index'] ? $data['priority_index'] : '1.0';}"></label>
                                <span class="help-block">{dr_lang('默认填写1.0')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('栏目priority值')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[priority_category]" value="{php echo $data['priority_category'] ? $data['priority_category'] : '1.0';}"></label>
                                <span class="help-block">{dr_lang('默认填写1.0')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('内容priority值')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[priority_show]" value="{php echo $data['priority_show'] ? $data['priority_show'] : '1.0';}"></label>
                                <span class="help-block">{dr_lang('默认填写1.0')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('缓存自动更新周期')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[autotime]" value="{php echo (int)$data['autotime'];}"></label>
                                <span class="help-block">{dr_lang('单位小时，定时更新地图脚本数据')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">安装代码</label>
                            <div class="col-md-9">

                                <span class="help-block">1、服务器开启伪静态功能，<a href="javascript:dr_help(671)">开启方法</a></span>
                                <span class="help-block">2、将以下代码手动写入到更目录的./config/rewrite.php 数组体[ ....  ]中</span>

                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label"></label>
                            <div class="col-md-9">
                                <pre style="padding: 10px;">
'sitemap\.txt' => 'index.php?s=sitemap&page=999', // 地图规则
'sitemap([0-9]+)\.txt' => 'index.php?s=sitemap&page=999&p=$1', // 地图规则分页
'sitemap\-([a-z]+)\-([0-9]+)\.txt' => 'index.php?s=sitemap&page=999&mid=$1&catid=$2', // 栏目地图规则
'sitemap\-([a-z]+)\-([0-9]+)\-([0-9]+)\.txt' => 'index.php?s=sitemap&page=999&mid=$1&catid=$2&p=$3', // 栏目地图规则分页
'sitemap\.xml' => 'index.php?s=sitemap&c=home&m=xml&page=998', // 地图规则
'sitemap([0-9]+)\.xml' => 'index.php?s=sitemap&c=home&m=xml&page=998&p=$1', // 地图规则分页
'sitemap\-([a-z]+)\-([0-9]+)\.xml' => 'index.php?s=sitemap&c=home&m=xml&page=999&mid=$1&catid=$2', // 栏目地图规则
'sitemap\-([a-z]+)\-([0-9]+)\-([0-9]+)\.xml' => 'index.php?s=sitemap&c=home&m=xml&page=999&mid=$1&catid=$2&p=$3', // 栏目地图规则分页
                                </pre>

                            </div>
                        </div>
                        {if dr_is_app('tag')}
                        <div class="form-group">
                            <label class="col-md-2 control-label"></label>
                            <div class="col-md-9">
                                <code style="padding: 10px;">'tag.txt' => 'index.php?s=sitemap&c=home&m=tag&page=998', // 地图规则<br></code>

                            </div>
                        </div>
                        {/if}
                        <div class="form-group">
                            <label class="col-md-2 control-label">按栏目访问地图</label>
                            <div class="col-md-9">
                                <pre style="padding: 10px;">
sitemap-模块目录-栏目id.xml
sitemap-模块目录-栏目id-分页号.xml<br>
sitemap-模块目录-栏目id.txt
sitemap-模块目录-栏目id-分页号.txt
                                </pre>
                                <span class="help-block">{dr_lang('适用于按栏目主表分表的场景')}</span>
                            </div>
                        </div>
                    </div>
                </div>



            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <label> <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存设置')}</button></label>
            <label><a href="{SITE_URL}sitemap.txt" target="_blank" class="btn red"> <i class="fa fa-send"></i> {dr_lang('访问站点txt')}</a></label>
            <label><a href="{SITE_URL}sitemap.xml" target="_blank" class="btn blue"> <i class="fa fa-send"></i> {dr_lang('访问站点xml')}</a></label>
            {if dr_is_app('tag')}
            <label><a href="{SITE_URL}tag.txt" target="_blank" class="btn dark"> <i class="fa fa-send"></i> {dr_lang('访问Tag.txt')}</a></label>
            {/if}
        </div>
    </div>
</form>



{template "footer.html"}